/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.designPatterns.structural.adapter;

/**
 *
 * @author 210012285
 */
public class TemperatureObjectReporter implements TemperatureInfo{
 
    CelciusReporter celciusRepoter;
    
    public TemperatureObjectReporter(){
        celciusRepoter =new CelciusReporter();
    }
   
    
    @Override
    public double getTemperatureInF() {
        return cToF(celciusRepoter.getTemperatureInC());
    }

    @Override
    public void setTemperatureInF(double temperatureInF) {
        celciusRepoter.setTemperatureInC(fToC(temperatureInF));
    }

    @Override
    public double getTempreratureInC() {
        return celciusRepoter.getTemperatureInC();
    }

    @Override
    public void setTempreratureInC(double temperatureInF) {
         celciusRepoter.setTemperatureInC(temperatureInF);
    }
    
    
     private double fToC(double f){
        
        return ((f-32)*5/9);
    }
    private double cToF(double c){
        return ((c*9/5)+32);
    }
    
}
